1. Field of the Invention
The present invention relates to a file system, and more particularly, to a method of managing data of a file system using a database management system.
2. Description of the Related Art
Unlike in the past, the recent development of multimedia technologies has enabled many consumer electronics products, such as personal video recorders, camcorders, and mobile phones, to be offered with embedded hard disks, and thus research projects on a technology for efficiently managing data using disks are being actively carried out.
In a file system determining a variety of policies related to input and output of data to and from a disk, consistency is a very important issue. Consistency of a file system can be divided into consistency of metadata and consistency of data. The metadata of a file system includes information about an inode, a directory, a free space of a disk, and a free inode. If operations related to these metadata items are performed as a transaction, the consistency of the metadata can be maintained.
Likewise, the consistency of data can be maintained through a data transaction, and if a data transaction for updating part of a file is aborted in the middle of the update operation, the data transaction is completed or discarded as if the transaction had never been performed to begin with.
Meanwhile, a database management system (DBMS) reliably stores data by using a fast and effective data structure and guarantees transactions. In the past, there have been attempts to secure consistency of a file system by applying this DBMS solution to an operating system (OS).
FIG. 1 is a block diagram illustrating a structure of a related art file system employing a database.
In the file system illustrated in FIG. 1, the metadata and file data of a file system are managed by using a kernel Berkeley database (KBDB), and the database is stored in a traditional file system (e.g., Ext2). In this structure, all operations of the file system are performed through a DBMS.
For example, when a predetermined file is read, the DBMS is accessed, and file data stored in block.db is copied into a buffer cache, and when data is written in a file, data stored in the buffer cache is stored in a record corresponding to the data in block.db. Operations other than file input and/or output operations are also performed by using the DBMS, and thus the consistency of the file system can be guaranteed.
However, due to its dependency on the traditional file system (Ext2) storing the databases, this KBDB file system (KBDBFS) cannot be optimized with respect to a variety of environments. That is, the DBMS (KBDB) provides only transactional operations, and the size of a file system, disk allocation, and the like are determined by a file system storing databases. For example, when data is stored on a disk in this file system, the file system (KBDBFS) inputs data into the DBMS (KBDB) and the DBMS (KBDB) stores the data on the disk by using the traditional file system Ext2 and thus the file system (KBDBFS) cannot participate in the layout of the actual disk. Accordingly, according to this file system, even though an algorithm optimized for an environment is designed, it is impossible to apply the optimized algorithm to the allocation of blocks on a disk. Also, in a multimedia environment where the file size is generally large, the size of a log generated by the DBMS increases and thus the performance of the file system is deteriorated.